package cn.haona.game.simb.object;

import java.sql.Timestamp;
import java.util.HashMap;

import cn.haona.db.RelevanceBean;

/**
 * 
* <p>Title: Persistence</p>
* <p>Description: 持久化</p>
* <p>Company: xunjie</p> 
* @author    shenhao
* @date       2010-3-8
 */
public interface Persistence
{
	
	Long NO_ID=-1L;
	
	final public static String ADDEDON = "ADDEDON";
	final public static String UPDATEON = "UPDATEON";
	final public static String STATUS = "STATUS";
	//名字
	final public static String NAME = "NAME";
	
	void setId(Long id);
	Long getId();
	
	//得到主键名
	String getPrimaryKeyName();
	
	String getTableName();
	void setTableName(String tableName);
	
	void setName(String newName);
	String getName();
	
	void setAddedDate(Timestamp timestamp);
	Timestamp getAddedDate();
	void setUpdateDate(Timestamp timestamp);
	Timestamp getUpdateDate();
	
	void setStatus(Integer status);
	Integer getStatus();
	
	//初始化我
    void initMe();
	
	//第一次持久化我
	Long persisMeFirstTime();
	//持久化参数
	boolean persisParam(String keyName, Object param);
	//持久化我
	boolean persisMe();
	//更新我
	Persistence updateMe();
	//缓存我
	boolean cacheMe();
	
	//返回反射关联集合
	HashMap<String, RelevanceBean> getReflectRelevance();
	
	//设置反射关联
	void setReflectRelevance(HashMap<String, RelevanceBean> reflectRelevance);
	
}
